﻿<%--<%@ Page Language="C#" MasterPageFile="MyStudy.master" AutoEventWireup="true" CodeFile="OpenCourseWareCommentNew.aspx.cs" Inherits="Theme_3_OpenCourseWareCommentNew" Title="Untitled Page" %>
--%>
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OpenCourseWareCommentNew.aspx.cs" Inherits="Theme_3_OpenCourseWareCommentNew" %>
<%@ Register Src="UserControls/ResourceClickTaxis.ascx" TagName="rct" TagPrefix="rct" %>
<%--<%@ Register Src="UserControls/OtherCourseResource.ascx" TagName="ocr" TagPrefix="ocr" %>--%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title>无标题页</title>
    <link type="text/css" href="css/lms.css" rel="stylesheet" />
    <script src="../../js/jquery-1.2.js" language="javascript" type="text/javascript"></script>

    <script language="javascript">
        		
		        function UnShow()
                    {
                       document.getElementById("Show").style.display="";
                       document.getElementById("UnShow").style.display="none";
                       document.getElementById("Comment").style.display="none";
                    }
                     function Show()
                    {
                       document.getElementById("Show").style.display="none";
                       document.getElementById("UnShow").style.display="";
                       document.getElementById("Comment").style.display="";
                    }
                    
                   function checkGrade()
                   {
                   var vObj=findFrame(window.MainFrame);
                   vObj.MediaPlayer.Controls.Pause();
                   var ul="CheckGrade.aspx?ResourceID=<%=_ResourceID %>";
                   window.showModalDialog(ul,window,"dialogWidth: 800px; dialogHeight: 600px;status: no; help: no");
                   }
                    function checkGradeContent()
                   {
                   var vObj=findFrame(window.parent.MainFrame);
                   vObj.MediaPlayer.Controls.Pause();
                   var TimePosition =  parseInt(vObj.MediaPlayer.Controls.currentPosition);
                   window.alert(TimePosition);
                   var url="<%=AddCommentUrl %>"+'&TimePosition='+TimePosition;
                   
                   window.alert(url);
                   window.document.open(url);
                   window.document.close();
                   }
                   


                    function findFrame(win)
                    {
                        var frmname;
                        if(win.MediaPlayer!=null)
                        {
                          return win;
                        }
                        else
                        {
                            frmname=win.name;
                        //	alert(frmname!="LeftupFrame");
                            if (frmname!="LeftupFrame")
                            {
                                if(win.frames.length>0)
                                {
                                   for (i=0;i<win.frames.length;i++)
                                   {
                                       if(win.frames[i]!=null)
                                       {
                                          if(win.frames[i].name=="LeftupFrame")
                                          {
                                             win=win.frames[i];
                                             return win;
                                          }
                                          else
                                          {
                                             if (win.frames[i].frames.length>0)
                                             {
                                                 return findFrame(win.frames[i]); 
                                             }
                                             else
                                             {
                                                return window.parent.MainFrame;
                                             }
                                                  
                                          }
                                       }
                                   }
                                }
                            }
                            else
                            {
                              
                               return win;           
                            }
                        }
                    }
                     // 去掉字符串的头空格（左空格）
                    function LTrim(str){ 
                        var i;
                        for(i=0;i<str.length; i++) {
                            if(str.charAt(i)!=" ") break;
                        }
                        str = str.substring(i,str.length);
                        return str;
                    }
                    
                    // 去掉字符串的尾空格（右空格）
                    function RTrim(str){
                        var i;
                        for(i=str.length-1;i>=0;i--){
                            if(str.charAt(i)!=" ") break;
                        }
                        str = str.substring(0,i+1);
                        return str;
                    }
                    
                    // 去掉字符串的头尾空格（左右空格）
                    function Trim(str){
                        return LTrim(RTrim(str));
                    }
                    
                    //获取指定名称的cookie的值
                    function getCookie2(objName){           
                        var arrStr = document.cookie.split(";");
                        for(var i = 0;i < arrStr.length;i ++)
                        {    
                            var temp = arrStr[i].split("=");                
                            if(Trim(temp[0]) == Trim(objName)) 
                                return unescape(temp[1]);   
                        }
                    }
                    function   setCookie(name,value) {     
                        var   Days   =   30;               //此   cookie   将被保存   30   天     
                        var   exp     =   new   Date();         //new   Date( "December   31,   9998 ");     
                        exp.setTime(exp.getTime()   +   Days*24*60*60*1000);     
                        document.cookie   =   name   +   "= "+   escape(value)   + ";expires= "+   exp.toGMTString(); 
                    }

        		
			function vaild(){
			
			   
			     var vObj=findFrame(window.MainFrame);
			   
               vObj.MediaPlayer.Controls.Pause();
//                window.parent.MainFrame.MediaPlayer.Controls.Pause();
               
               var TimePosition =  parseInt(vObj.MediaPlayer.Controls.currentPosition);
              
               var url="<%=AddCommentUrl %>"+'&TimePosition='+TimePosition;
       
       
				var flag=true;
				var rand=Math.random();
				var filter=$("#txt_content").val();
				//var filter=window.form1.txt_content.value;
			
				if(filter.length<1)
				{
				    
				    alert("<%=config.GetLanagerValueByKey("theme_Comment_AddComment_Msg1", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
				    return false;
				
				}
				if(filter.length>4000)
				{
				    
				    alert("<%=config.GetLanagerValueByKey("theme_Comment_AddComment_Msg2", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
				    return false;
				
				}
				$.ajax({
						type: "get",
						dataType: "text",
						url: "AddCommentNew.aspx",
						data: "filter="+escape(filter)+"&ResourceID="+"<%=ResourceID %>"+"&position="+TimePosition,
						async: false,
						success: function(msg){
							if(msg==0){
//								alert("<%=config.GetLanagerValueByKey("Msg_ManagerQuestion_WorkNo", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
//								
							}
							else{
//								alert("<%=config.GetLanagerValueByKey("Msg_ManagerQuestion_WorkOK", PowerCreator.LMS.Language.LanagetItemType.Page)%>");
//
								flag=true;
								
							}
						}
					});
					window.form1.txt_content.value="";
					window.Evaluation.location.reload();
					vObj.MediaPlayer.Controls.Play();
				return flag;
			}
		</script>

</head>
<body  oncontextmenu="return false">
 <form id="form1" runat="server">
    <table width="983" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td class="dlbg">
                <asp:Label ID="lal_UserLogin" runat="server"></asp:Label>
                <asp:LinkButton ID="btn_out" runat="server" Text="注销1" OnClick="btn_out_Click" Visible="false"></asp:LinkButton>
            </td>
        </tr>
        <tr>
            <td class="top" valign="top" align="right">
            </td>
        </tr>
    </table>
    <table width="983" border="0" cellspacing="0" cellpadding="0" align="center" class="nav">
        <tr>
            <td width="35" height="34" class="bg_dh">
                &nbsp;
            </td>
            <td align="center" class="bg_dh" id="menu1">
                <a href="Default.aspx" onclick="TopTest('1')" target="_self">
                    <%=config.GetLanagerValueByKey("theme_menu_default", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu2">
                <a href="News.aspx" onclick="TopTest('2')" target="_self">
                    <%=config.GetLanagerValueByKey("theme_menu_News", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu3">
                <a href="StudyCenter.aspx" target="_self" onclick="TopTest('3');">
                    <%=config.GetLanagerValueByKey("theme_menu_Study", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu4">
                <a href="Channel.aspx" target="_self" onclick="TopTest('4');">
                    <%=config.GetLanagerValueByKey("theme_menu_Broadcast", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu5">
                <a href="ActiveClass.aspx" target="_self" onclick="TopTest('5');">
                    <%=config.GetLanagerValueByKey("theme_menu_ActiveClass", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu6">
                <a href="refer.aspx" target="_self" onclick="TopTest('6');">
                    <%=config.GetLanagerValueByKey("theme_menu_Refer", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu7">
                <a href="DownLoad.aspx" target="_self" onclick="TopTest('7');">
                    <%=config.GetLanagerValueByKey("theme_menu_Download", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td align="center" class="bg_dh">
                |
            </td>
            <td align="center" class="bg_dh" id="menu8">
                <a href="bbs.aspx" target="_self" onclick="TopTest('8');">
                    <%=config.GetLanagerValueByKey("theme_menu_Forum", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
            </td>
            <td width="35" class="bg_dh">
                &nbsp;
            </td>
        </tr>
        <tr>
            <td style="height: 10px" colspan="17">
            </td>
        </tr>
    </table>
<%--<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">--%>


    <table border="0" cellspacing="0" width="983" cellpadding="0" align="center">
        <tr>
            <td class="jdstyle">
                <a href="Default.aspx">
                    <%=config.GetLanagerValueByKey("AspNetPager1StyleFirstPageText", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
                > <a href="StudyCenter.aspx">
                    <%=config.GetLanagerValueByKey("theme_menu_Study", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>> <a href="#"><%=config.GetLanagerValueByKey("web_Project_OpenCourseWare", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>> <a href="#"><asp:Label ID="lbl_ResourceName" runat="server" Text=""></asp:Label></a>
            </td>
        </tr>
    </table>
    <table width="983" border="0" cellspacing="0" cellpadding="0" align="center">
        <tr>
            <td>
                <script language="javascript" type="text/javascript">
                                            setCookie("showcomment","1");
	                                        var str = "";
//	                                        var height=window.screen.availHeight-117;
//	                                        height=450;
	                                        var height=516;

	                                        str += "<table width='100%' height='"+height+"' border='0' cellpadding='0' cellspacing='0'><tr><td valign='top'>";
	                                        str+="<iframe id='MainFrame' name='MainFrame' frameborder='0' scrolling='no' width='100%'  height="+height+"  src='<%=fileUrl %>'></iframe></td></tr></table>";
	                                        document.write(str);	
                                            </script>

            </td>
        </tr>
    </table>
    <br />





<table width="983" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td valign="top">
                <table width="715" border="0" cellspacing="0" cellpadding="0" class="border_style2"
                    height="128">
                    <tr>
                        <td class="bt5">
                            <%=config.GetLanagerValueByKey("web_Project_OpenCourseWare_msg1", PowerCreator.LMS.Language.LanagetItemType.Page)%>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <%--<ocr:ocr ID="ocr1" runat="server" />--%>
                            
                            <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" class="kejianlianjie">
    <tr>
    
     <asp:Repeater ID="rpt_OtherCourseResource" runat="server" OnItemCommand="rpt_ResourceList_ItemCommand">
        <ItemTemplate>
        
         <td align="left" style="width: 88px;">
            <table border="0" cellpadding="0" cellspacing="0" width="80">
                <tr>
                    <td>
                    <asp:Label ID="lbl_ResourceID" runat="server" Text='<%#Eval("ProjectResourceID")%>' Visible="false"></asp:Label>
                        <a <%#Eval("CoursersResourceEntry")%>><img alt="<%#Eval("ResourceName")%>" src="<%#Eval("CoursersResourceImageUrl")%>" class="imgstyle" width="80" height="58" /></a>
                    </td>
                </tr>
                <tr>
                    <td>
                        <a <%#Eval("CoursersResourceEntry")%>><%#PowerCreator.LMS.Common.Utils.StringUtils.GetSubstringLue(Eval("ResourceName").ToString(),5)%></a>
                    </td>
                </tr>
            </table>
        </td>
        
        
            
        </ItemTemplate>
    </asp:Repeater>
       
       
    </tr>
</table>

                            
                        </td>
                    </tr>
                </table>
            </td>
            <td align="right">
                <table width="254" border="0" cellspacing="0" cellpadding="0" class="border_style2"
                    height="128">
                    <tr>
                        <td style="padding-top: 8px" valign="top">
                            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
                                <tr>
                                    <td height="30">
                                        <img src="images/jth.jpg" width="10" height="11" /><%=config.GetLanagerValueByKey("theme_Comment_StudyNum", PowerCreator.LMS.Language.LanagetItemType.Page)%>（<asp:Label ID="lab_ClickNum" runat="server" Text="261"></asp:Label>）&nbsp;
                                    </td>
                                    <td rowspan="2" valign="middle" style="font-size: 33px; color: #FF9900; font-family: Geneva, Arial, Helvetica, sans-serif">
                                        <asp:Label ID="lab_AvgScore" runat="server" Text="8.0"></asp:Label><span style="font-size: 20px; color: #666; font-weight: bold; font-family: Geneva, Arial, Helvetica, sans-serif"><%=config.GetLanagerValueByKey("theme_Comment_Score", PowerCreator.LMS.Language.LanagetItemType.Page)%></span>
                                    </td>
                                </tr>
                                <tr>
                                    <td <%--height="30"--%>>
                                    
                                        <%--<img src="images/jth.jpg" width="10" height="11" />浏览次数（261）&nbsp;--%>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="2" style="text-align: right; padding-right: 10px; height: 15px; line-height: 15px;">
                                    
                                    <asp:Label ID="lab_Star" runat="server" Text='<img src="images/x1.jpg" width="15" height="14" /><img src="images/x2.jpg" width="15" height="14" /><img src="images/x2.jpg" width="15" height="14" />'></asp:Label>
                                    
                                       
                                    </td>
                                </tr>
                                <tr>
                                    <td height="40">
                                         <a href="#" onclick="checkGrade()"><%=config.GetLanagerValueByKey("theme_Comment_AddComment", PowerCreator.LMS.Language.LanagetItemType.Page)%></a>
                                    </td>
                                </tr>
                            </table>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
    </table>
    <br />
    <table width="983" border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
            <td valign="top">
                <table width="715" border="0" cellspacing="0" cellpadding="0" class="border_style2">
                    <tr>
                        <td>&nbsp;
                            
                        </td>
                    </tr>
                    <tr>
                        <td style="text-align: center">
                        
                        <textarea id="txt_content" cols="81" name="textarea" rows="5"  runat="server"></textarea>
                            &nbsp;<input type="button" name="发表评论" id="btn_send" value="发表评论" onclick="vaild()" />
                            
                            <iframe id='Evaluation' name='R_Evaluation' frameborder='0' scrolling='auto' width='100%' height="480" src='R_Evaluation.aspx?ResourceID=<%=_ResourceID%>'></iframe>
                        </td>
                    </tr>
                </table>
            </td>
            <td align="right" valign="top">
            <rct:rct ID="rct1" runat="server" />
            </td>
        </tr>
    </table>
    <br />



    <script language="javascript" for="window" event="onbeforeunload" type="text/javascript">        
       var iServerStartTime;
       var vObj=findFrame(window.MainFrame);   
        
       iServerStartTime=vObj.MediaPlayer.Controls.currentPosition; 
       function WriteLog() 
       {          
            var v = "<%=isUpdateCourse %>"
            v= "1";
            if(v=="1")
            {   
                window.location="<%=url %>&SscrlogCurrentPosition="+iServerStartTime;
            }
       }
       WriteLog();
            
    
    

</script>
    <script language="javascript" for="window" event="onload">
// sleep(5000); 
  
   try
  {
       var vObj=findFrame(window.MainFrame)  
        
       vObj.MediaPlayer.Controls.currentPosition=<%=_Position %>;
  }    
  catch(e)
  {
    
  }  

</script>

<%--
</asp:Content>--%>
    </div>
    </form>
</body>
</html>